#ifndef MODIFYMEMBEROVER_H
#define MODIFYMEMBEROVER_H

#include <QWidget>
#include "personmember.h"

class InquireSql;

enum LastClickModifyOver {comboBoxMemberLevel, lineEditDiscount,
                lineEditIntegration, lineEditMemberCardAmount,
                lineEditTotalSpending, lineEditConsumeTimes,
                pushButtonSaveOver};

namespace Ui {
class ModifyMemberOver;
}

class ModifyMemberOver : public QWidget
{
    Q_OBJECT
    
public:
    explicit ModifyMemberOver(QWidget *parent = 0);
    ~ModifyMemberOver();
    void displayMemberOver(const QString &);
    bool eventFilter(QObject *target, QEvent *event);
    void UpdateMemberLevel();
    
signals:
    void updateMemberProfile();

private slots:
    void on_comboBoxMemberLevel_currentIndexChanged(int index);

    void on_lineEditMemberCardAmount_editingFinished();

    void on_lineEditTotalSpending_editingFinished();

    void on_pushButtonSave_clicked();

    void on_pushButtonCancel_clicked();

    void on_lineEditDiscount_editingFinished();

    void on_lineEditConsumeTimes_editingFinished();

private:
    void eliminationPushButtonBorder();
    void initMemberLevel();
    QString completionPrice(const QString &);
    Ui::ModifyMemberOver *ui;
    InquireSql *m_sql;
    int m_lastClick;
    PersonMember m_personMember;
};

#endif // MODIFYMEMBEROVER_H
